﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClusterLibrary
{
    public class Circle : Shape
    {
        private int x;
        private int y;
        private int radius;

        public int X
        {
            get
            {
                return this.x;
            }
        }

        public int Y
        {
            get
            {
                return this.y;
            }
        }

        public int Radius
        {
            get
            {
                return this.radius;
            }
            set
            {
                this.radius = value;
            }
        }

        public Circle(int x, int y, int radius)
        {
            this.x = x;
            this.y = y;
            this.radius = radius;
        }

        public override void moveShape(int dx, int dy)
        {
            this.x += dx;
            this.y += dy;
        }

        public override bool isActive(int x, int y)
        {
            if ((x >= this.x - this.radius) && (x <= this.x + this.radius))
            {
                if ((y >= this.y - this.radius) && (y <= this.y + this.radius))
                {
                    return true;
                }
            }

            return false;
        }

        public override void drawShape(System.Drawing.Graphics g)
        {
            int tempX = this.x - this.radius;
            int tempY = this.y - this.radius;

            g.DrawEllipse(new Pen(Color.Black), tempX, tempY, 2 * this.radius, 2 * this.radius);
            //g.DrawEllipse(new Pen(Color.Black), this.x, this.y, this.radius, this.radius);
        }
    }
}
